//
//  YJBaseViewController.m
//  YJB
//
//  Created by 中电大维 on 16/5/12.
//  Copyright © 2016年 YJB. All rights reserved.
//

#import "THBaseVC.h"

@interface THBaseVC ()

@end

@implementation THBaseVC

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor =[UIColor whiteColor];
    //导航栏背景图片
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navBg"] forBarMetrics:UIBarMetricsDefault];
    //导航栏文字颜色
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
  //  self.navigationController.navigationBar.tintColor = NAVTITLECOLOR;
    //导航栏标题颜色、大小
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18.0f],NSForegroundColorAttributeName: [UIColor whiteColor]}];
    //导航栏返回按钮
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(backItemClick) image:@"back_white" highImage:nil title:nil];
}

//SB创建调用
- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self)
    {
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}

//代码创建调用
- (instancetype)init
{
    self = [super init];
    if (self)
    {
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}


//状态栏颜色
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

- (void)backItemClick
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (UIBarButtonItem *)customBackItemWithTarget:(id)target
                                       action:(SEL)action
{
    return nil;
}
@end
